<!DOCTYPE html>
<html>
<head>
<script src="resources/link-highlight-helper.js"></script>
<link rel="stylesheet" href="resources/link-highlight-style.css">
</head>
<body onload="runTest();" onclick="doNothing();">
<div style="will-change: transform; position: relative; left: 10px; top: 40px">
<a href="" id="targetLink" style="-webkit-tap-highlight-color: rgba(0, 255, 0, 0.5)">Target Link.</a>
</div>
<div style="position: relative; left: 10px; top: 70px">
This test is successful if no link highlight appears.
</div>
<script>
// This test makes sure a highlight does not survive beyond GestureLongPress.
function runTest() {
    var clientRect = document.getElementById('targetLink').getBoundingClientRect();
    x = (clientRect.left + clientRect.right) / 2;
    y = (clientRect.top + clientRect.bottom) / 2;
    if (window.testRunner)
        testRunner.waitUntilDone();

    if (window.eventSender) {
        // Generate valid link highlight.
        eventSender.gestureShowPress(x, y);

        // Generate long press ... this should cancel highlight.
        eventSender.gestureLongPress(x, y);
        window.setTimeout(function() { testRunner.notifyDone(); }, 0);
    } else {
        debug("This test requires DumpRenderTree.");
    }
}
</script>
</script>
</body>
</html>
